// Copyright (c) 2022, hzmes and contributors
// For license information, please see license.txt

frappe.ui.form.on('SRM Inquiry Of Supplier', {
	refresh: function(frm) {
		frm.add_custom_button(__('下推报价单'), () => {
			frm.call({
				method: "srm.srm.doctype.srm_inquiry_of_supplier.srm_inquiry_of_supplier.make_srm_quotation",
				args: {source_name: frm.docname},
				freeze_message: __("Creating Quotation ...")
			}).then((r)=>{
				var doclist = frappe.model.sync(r.message);
				frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
			});
		})
	}
});
